<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="lijun; 67086071; zwlijun@qq.com" />
<title>RIA Client API - BY 小网</title>
<link href="css/api.css" type="text/css" rel="stylesheet" />
</head>

<body>
  <ins>此文档用于描述RIAClient对象的属性和方法</ins>
  <div class="nav">
    <a href="#getType">getType()</a>
    <a href="#E">$E()</a>
    <a href="#T">$T()</a>
    <a href="#C">$C()</a>
    <a href="#X">$X()</a>
    <a href="#A">$A()</a>
    <a href="#D">$D()</a>
    <a href="#R">$R()</a>
    <a href="#I">$I()</a>
    <a href="#getBrowserInfo">getBrowserInfo()</a>
    <a href="#getDocumentSize">getDocumentSize()</a>
    <a href="#getViewportSize">getViewportSize()</a>
    <a href="#getScrollPosition">getScrollPosition()</a>
    <a href="#getScreenSize">getScreenSize()</a>
    <a href="#getOuterStyle">getOuterStyle()</a>
    <a href="#setOuterStyle">setOuterStyle()</a>
    <a href="#dynamicStyle">dynamicStyle()</a>
    <a href="#getTimeStamp">getTimeStamp()</a>
    <a href="#drag">drag()</a>
    <a href="#encode">encode()</a>
    <a href="#decode">decode()</a>
    <a href="#setCookie">setCookie()</a>
    <a href="#getCookie">getCookie()</a>
    <a href="#getParameter">getParameter()</a>
    <a href="#getParameterValues">getParameterValues()</a>
    <a href="#getPosition">getPosition()</a>
  </div>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getType方法<a name="getType"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取对象类型</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var type = RIAClient.getType(obj);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取对象类型</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">$E方法<a name="E"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>根据ID获取元素对象</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var el = RIAClient.$E(id, parent);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>根据ID获取元素对象，如果parnet不为null，则取parent下的元素，否则为document。</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">$T方法<a name="T"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>根据标签名获取元素集</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var items = RIAClient.$T(tagName);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>根据标签名获取元素集</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">$C方法<a name="C"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>建立一个新的元素</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var newElement = RIAClient.$C(tag);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>建立一个新的元素</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">$X方法<a name="X"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>建立一个新的文本节点</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var textNode = RIAClient.$X(text);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>建立一个新的文本节点</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">$A方法<a name="A"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>追加一个新的节点</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var node = RIAClient.$A(cNode, pNode);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>追加一个新的节点</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">$D方法<a name="D"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>删除一个节点</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var node = RIAClient.$D(cNode, pNode);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>删除一个节点</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">$R方法<a name="R"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>替换一个节点</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var node = RIAClient.$R(nNode, oNode);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>替换一个节点，如果参考节点没有父级节点则返回null</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">$I方法<a name="I"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>插入一个新的节点</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var node = RIAClient.$I(newNode, refNode);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>插入一个新的节点，如果没参考节点没有父级节点则返回null</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>

</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getBrowserInfo方法<a name="getBrowserInfo"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取浏览器版本号及类型</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var info = RIAClient.getBrowserInfo();</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取浏览器版本号及类型</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var type = info.browser;
var ver = info.version;
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getDocumentSize方法<a name="getDocumentSize"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取文档大小</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var doc = RIAClient.getDocumentSize();</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取文档大小</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var width = doc.width;
var height = doc.height;
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getViewportSize方法<a name="getViewportSize"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取视窗大小</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var viewport = RIAClient.getViewportSize();</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取视窗大小</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var width = viewport.width;
var height = viewport.height;
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getScrollPosition方法<a name="getScrollPosition"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取视窗大小</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var scroll = RIAClient.getScrollPosition();</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取视窗大小</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var left = scroll.left;
var top = scroll.top;
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getScreenSize方法<a name="getScreenSize"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取视窗大小</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var screen = RIAClient.getScreenSize();</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取视窗大小</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var width = screen.width;
var height = screen.height;
var offsetLeft = screen.offsetLeft;
var offsetTop = screen.offsetTop;
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getOuterStyle方法<a name="getOuterStyle"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>从外部引用的css或style标签中获取css属性</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var style = RIAClient.getOuterStyle(selector, attr);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>从外部引用的css或style标签中获取css属性</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var width = RIAClient.getOuterStyle("#panel", "width");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">setOuterStyle方法<a name="setOuterStyle"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>从外部引用的css或style标签中获取css属性</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>RIAClient.setOuterStyle(selector, attr, value);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>从外部引用的css或style标签中获取css属性</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
RIAClient.setOuterStyle("#panel", "width", "100px");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">dynamicStyle方法<a name="dynamicStyle"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>动态设置样式</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var style = RIAClient.dynamicStyle(cssTexts);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>动态设置样式</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var cssTexts = [
  'body{font-size:12px; margin:0px;}',
  'table{margin-top:10px; background-color:gray;}',
  'th, td{background-color:white; text-align:left;}'
]
var style = RIAClient.dynamicStyle(cssTexts);
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getTimeStamp方法<a name="getTimeStamp"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取时间戳</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var time = RIAClient.getTimeStamp();</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取时间戳</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var time = RIAClient.getTimeStamp();
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">drag方法<a name="drag"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>拖动</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>RIAClient.drag(...args);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>拖动，动态参数， 为拖动对象的ID名</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
RIAClient.drag("id1");
RIAClient.drag("id1", "id2");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">encode方法<a name="encode"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>编码</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var encodeStr = RIAClient.encode(str);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>URI编码</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var str = RIAClient.encode("hello world!");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">decode方法<a name="decode"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>解码</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var decodeStr = RIAClient.decode(str);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>URI解码</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var str = RIAClient.decode(RIAClient.encode("hello world!"));
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">setCookie方法<a name="setCookie"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>设置cookie</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>RIAClient.setCookie(key, value, domain, expires);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>设置cookie</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
//session
RIAClient.setCookie("nickname", "小网", "wivita.com");
//30分钟过期
RIAClient.setCookie("nickname", "小网", "wivita.com", 0.5);
//删除
RIAClient.setCookie("nickname", "小网", "wivita.com", -1);
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getCookie方法<a name="getCookie"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取cookie值</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var value = RIAClient.getCookie(key);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取cookie值</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var nickname = RIAClient.getCookie("nickname");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getParameter方法<a name="getParameter"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取URL参数</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var value = RIAClient.getParameter(key);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取URL参数</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var nickname = RIAClient.getParameter("nickname");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getParameterValues方法<a name="getParameterValues"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取URL参数</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var items = RIAClient.getParameterValues(key);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取URL参数</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var items = RIAClient.getParameterValues("items");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getPosition方法<a name="getPosition"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取相对位置</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var pos = RIAClient.getPosition(obj);</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取相对位置</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var pos = RIAClient.getPosition(RIAClient.$E("test"));
var x = pos.x;
var y = pos.y;
</pre>
        </td>
      </tr>
    </tbody>
  </table>
</body>
</html>
